package com.xbongbong.saas.domain.dao;/*/*/

import com.xbongbong.saas.domain.entity.WorkOrderTemplateEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderTemplateEntityExt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/5 14:03
 * @since v1.0
 * @version v1.0
 */
@Repository
@Mapper
public interface WorkOrderTemplateDao {

    Integer insert(WorkOrderTemplateEntity workOrderTemplateEntity);

    Integer update(WorkOrderTemplateEntity entity);

    List<WorkOrderTemplateEntityExt> findEntitys(@Param("param") Map<String, Object> param);

    List<WorkOrderTemplateEntity> findEntity(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    WorkOrderTemplateEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer moveToDefault(@Param("categoryId") Long categoryId, @Param("defaultId") Long defaultId, @Param("corpid") String corpid);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 工单模板批量修改
     * @param workOrderTemplateEntities
     * @param corpid
     */
    Integer updateBatch(@Param("list") List<WorkOrderTemplateEntity> workOrderTemplateEntities, @Param("corpid") String corpid);



    /**
     * 批量插入实体
     * @param list
     * @return 返回数据的列表
     */
    Integer insertBatch(@Param("list") List<WorkOrderTemplateEntity> list);
    /**
     * 批量删除
     * @param list 主键id集合
     * @param corpid
     * @author xingxing.xiao
     */
    Integer deleteBatch(@Param("list") List<Long> list, @Param("corpid") String corpid);

}
